Transitions the underlying
Task<(Of <(TResult>)>) into the
Faulted
state.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub SetException ( _
exceptions As IEnumerable(Of Exception) _
) |
C# |
---|
public void SetException(
IEnumerable<Exception> exceptions
) |
Parameters
- exceptions
- Type: System.Collections.Generic..::.IEnumerable<(Of <(Exception>)>)
The collection of exceptions to bind to this Task<(Of <(TResult>)>).
Exceptions
Exception | Condition |
---|
System..::.ArgumentNullException | The exceptions argument is null. |
System..::.ArgumentException | There are one or more null elements in exceptions. |
System..::.InvalidOperationException |
The underlying Task<(Of <(TResult>)>) is already in one
of the three final states:
RanToCompletion,
Faulted, or
Canceled.
|
System..::.ObjectDisposedException | The Task was disposed. |
See Also